import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/social_card_entity.dart';

SocialCardEntity $SocialCardEntityFromJson(Map<String, dynamic> json) {
  final SocialCardEntity socialCardEntity = SocialCardEntity();
  final String? socialSecurityNumber = jsonConvert.convert<String>(
      json['socialSecurityNumber']);
  if (socialSecurityNumber != null) {
    socialCardEntity.socialSecurityNumber = socialSecurityNumber;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    socialCardEntity.name = name;
  }
  final String? gender = jsonConvert.convert<String>(json['gender']);
  if (gender != null) {
    socialCardEntity.gender = gender;
  }
  final String? group = jsonConvert.convert<String>(json['group']);
  if (group != null) {
    socialCardEntity.group = group;
  }
  final String? bornNum = jsonConvert.convert<String>(json['bornNum']);
  if (bornNum != null) {
    socialCardEntity.bornNum = bornNum;
  }
  final String? born = jsonConvert.convert<String>(json['born']);
  if (born != null) {
    socialCardEntity.born = born;
  }
  final String? cardIdNum = jsonConvert.convert<String>(json['cardIdNum']);
  if (cardIdNum != null) {
    socialCardEntity.cardIdNum = cardIdNum;
  }
  final String? cardType = jsonConvert.convert<String>(json['cardType']);
  if (cardType != null) {
    socialCardEntity.cardType = cardType;
  }
  final String? cardVersion = jsonConvert.convert<String>(json['cardVersion']);
  if (cardVersion != null) {
    socialCardEntity.cardVersion = cardVersion;
  }
  final String? initCode = jsonConvert.convert<String>(json['initCode']);
  if (initCode != null) {
    socialCardEntity.initCode = initCode;
  }
  final String? cardStartDate = jsonConvert.convert<String>(
      json['cardStartDate']);
  if (cardStartDate != null) {
    socialCardEntity.cardStartDate = cardStartDate;
  }
  final String? cardEndDate = jsonConvert.convert<String>(json['cardEndDate']);
  if (cardEndDate != null) {
    socialCardEntity.cardEndDate = cardEndDate;
  }
  final String? cardNum = jsonConvert.convert<String>(json['cardNum']);
  if (cardNum != null) {
    socialCardEntity.cardNum = cardNum;
  }
  final String? socialCardKxx = jsonConvert.convert<String>(
      json['socialCardKxx']);
  if (socialCardKxx != null) {
    socialCardEntity.socialCardKxx = socialCardKxx;
  }
  return socialCardEntity;
}

Map<String, dynamic> $SocialCardEntityToJson(SocialCardEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['socialSecurityNumber'] = entity.socialSecurityNumber;
  data['name'] = entity.name;
  data['gender'] = entity.gender;
  data['group'] = entity.group;
  data['bornNum'] = entity.bornNum;
  data['born'] = entity.born;
  data['cardIdNum'] = entity.cardIdNum;
  data['cardType'] = entity.cardType;
  data['cardVersion'] = entity.cardVersion;
  data['initCode'] = entity.initCode;
  data['cardStartDate'] = entity.cardStartDate;
  data['cardEndDate'] = entity.cardEndDate;
  data['cardNum'] = entity.cardNum;
  data['socialCardKxx'] = entity.socialCardKxx;
  return data;
}

extension SocialCardEntityExtension on SocialCardEntity {
  SocialCardEntity copyWith({
    String? socialSecurityNumber,
    String? name,
    String? gender,
    String? group,
    String? bornNum,
    String? born,
    String? cardIdNum,
    String? cardType,
    String? cardVersion,
    String? initCode,
    String? cardStartDate,
    String? cardEndDate,
    String? cardNum,
    String? socialCardKxx,
  }) {
    return SocialCardEntity()
      ..socialSecurityNumber = socialSecurityNumber ?? this.socialSecurityNumber
      ..name = name ?? this.name
      ..gender = gender ?? this.gender
      ..group = group ?? this.group
      ..bornNum = bornNum ?? this.bornNum
      ..born = born ?? this.born
      ..cardIdNum = cardIdNum ?? this.cardIdNum
      ..cardType = cardType ?? this.cardType
      ..cardVersion = cardVersion ?? this.cardVersion
      ..initCode = initCode ?? this.initCode
      ..cardStartDate = cardStartDate ?? this.cardStartDate
      ..cardEndDate = cardEndDate ?? this.cardEndDate
      ..cardNum = cardNum ?? this.cardNum
      ..socialCardKxx = socialCardKxx ?? this.socialCardKxx;
  }
}